Digital cameras are commonly incorporated into a wide variety of devices. In this disclosure, a digital camera device refers to any device that can capture one or more digital images, including devices that can capture still images and devices that can capture sequences of images to record video. By way of example, digital camera devices may comprise stand-alone digital cameras or digital video camcorders, camera-equipped wireless communication device handsets such as mobile, cellular or satellite radio telephones, camera-equipped personal digital assistants (PDAs), computer devices that include cameras such as so-called “web-cams,” or any devices with digital imaging or video capabilities.
JPEG is a commonly used method of compression for images. The name JPEG stands for Joint Photographic Experts Group, the name of the committee that created the standard. The JPEG encoding process includes several steps. First, the pixels of an image may be converted from red green and blue (RGB) to YCbCr, which includes one luma component (Y), representing brightness, and two chroma components (Cb and Cr), representing color.
Next, the resolution of the chroma data may be reduced, e.g., usually by a factor 2, to reflect the fact that the human eye is less sensitive to fine color details than to fine brightness details. Then, the image is split into blocks of 8×8 pixels, and for each block, each of the Y, Cb, and Cr data undergoes a discrete cosine transform (DCT). The amplitudes of the frequency components are then quantized. Since human vision is more sensitive to variations in color or brightness over large areas, than to the strength of high-frequency brightness variations, the magnitude of the high-frequency components may be stored with less accuracy than the low-frequency components. The quality setting of the encoder may be adjusted to control the extent of resolution for each frequency component. If an excessively low quality setting is used, the high-frequency components may be discarded altogether.
After the DCT process, the resulting data for all 8×8 blocks is further compressed, e.g., using differential coding techniques, and entropy coding techniques such as zig-zag scanning, Huffman coding, run-length coding, variable length coding (VLC) methodologies, application of coded block patterns (CBPs), or the like. The decoding process reverses the different JPEG coding steps to reproduce an array of pixel values that can be used to drive a display.
In many imaging applications, rotation of an image is desirable. For example, if an image is captured by a camera that is rotated 90 degrees, it may be desirable to rotate the image data so that the image is not rotated when the image is output on a display. Conventionally, an encoded JPEG image is rotated by decoding the image, rotating the decoded image in the pixel domain, and then re-encoding the rotated image. This conventional technique is very memory intensive because it requires temporary storage of one or more copies of an uncompressed image and storage of the compressed image before and after the rotation.